package cn.com.weshare.lock.jmm;

import org.openjdk.jol.info.ClassLayout;
import org.openjdk.jol.vm.VM;

public class ObjectMarkWord {

    public static void main(String[] args) {
        // VM的细节情况
//        System.out.println(VM.current().details());

        // 对象分配字节都是8的整数倍
//        System.out.println(VM.current().objectAlignment());
//
        Object object = new Object();
        System.out.println(object.hashCode());
        System.out.println(Integer.toHexString(object.hashCode()));
        System.out.println(Integer.toBinaryString(object.hashCode()));

        //  1011011010010000000110011111001
        // 01011011010010000000110011111001

//
//        System.out.println(object.hashCode());
//
        System.out.println(ClassLayout.parseInstance(object).toPrintable());
    }

}

class Person{
//    double d = 10;
}

